//
//  LXGuideTool.m
//  绿稀全球购
//
//  Created by 诸葛孔明 on 16/7/16.
//  Copyright © 2016年 SJT. All rights reserved.
//

#import "LXGuideTool.h"

#import "LXNewFeatureViewController.h"

#import "LXSaveTool.h"

#import "LXNavigationController.h"

#import "HomeViewController.h"


#import "LCTabBarController.h"

#define LXVersion @"version"

@implementation LXGuideTool

+ (void)chooseRootViewController:(UIWindow *)window
{
    NSString *currentVersion = [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"];
    NSString *lastVersion = [LXSaveTool objectForKey:LXVersion];
    
    NSLog(@"当前版本号%@===================上次版本号%@",currentVersion,lastVersion);

    if ([currentVersion isEqualToString:lastVersion]) {
        
        LCTabBarController * tbvc = [[LCTabBarController alloc] init];
        window.rootViewController = tbvc;
        [window makeKeyAndVisible];
    }else{
            LXNewFeatureViewController *newFeature = [[LXNewFeatureViewController alloc] init];
            window.rootViewController = newFeature;
        
            [LXSaveTool setObject:currentVersion forKey:LXVersion];
        
            [window makeKeyAndVisible];
    }

}

@end
